package itman.elm.controller;

import itman.elm.po.Business;
import itman.elm.serviece.BusinessService;
import itman.elm.serviece.impl.BusinessServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.SQLException;
import java.util.List;
@RestController
@RequestMapping("/BusinessController")
public class BusinessController {
    @Autowired
    private BusinessService businessService;


    @RequestMapping("/listBusinessByOrderTypeId")
    public List<Business> listBusinessByOrderTypeId( Integer orderTypeId )throws Exception{

            return businessService.listBusinessByOrderTypeId(orderTypeId);
    }

    @RequestMapping("/getBusinessById")
    public Business getBusinessById( Integer businessId )throws Exception{
            return businessService.getBusinessById(businessId);

    }


}
